# -*- coding: utf-8 -*-
# @Time : 2018/12/27 10:08
# @Author : Administrator
# @File : Interface.py
# @Project : python_demo
# @title :
import requests
url='http://192.168.7.128:8080/WoniuSales/customer/add'
data={'customername':'test001','customerphone':'18030795881','childsex':'女'.encode(),'childdate':'1991-01-01','creditkids':'0','creditcloth':'0'}
res=requests.post(url=url,data=data)
assert res.text =='add-successful'


url='http://192.168.7.128:8080/WoniuSales/customer/add'
data={'customername':'test001','customerphone':'18030795881','childsex':'女'.encode(),'childdate':'1991-01-01','creditkids':'0','creditcloth':'0'}
res=requests.post(url=url,data=data)
assert res.text =='already-added'


url='http://192.168.7.128:8080/WoniuSales/customer/add'
data={'customername':'','customerphone':'18030795881','childsex':'女'.encode(),'childdate':'1991-01-01','creditkids':'0','creditcloth':'0'}
res=requests.post(url=url,data=data)
assert res.text =='add-failed'